extends ../../layout

block content
    .container
        .row
            .col-md-8
                embed(src='#{movie.play}', width='760px', height='600px', type='application/x-shockwave-flash')
                h3 评论区
                ul.media-list
                    each comment in comments
                        li.media
                            .media-left
                                a.reply(href='javascript:void(0)')
                                    img.media-object(src='', alt='', width='64px', height='64px')
                                span.sr-only #{comment._id}
                            .media-body
                                h4.media-heading #{comment.user.name}
                                p #{comment.content}
                                if comment.replies && comment.replies.length > 0
                                    ul.media-list
                                        each reply in comment.replies
                                            li.media
                                                .media-left
                                                    a
                                                        img.media-object(src='', alt='', width='64px', height='64px')
                                                .media-body
                                                    h4.media-heading #{reply.user.name}
                                                    p #{reply.content}
                        hr
                form(method='POST', action='/comment/create')
                    .form-group
                        input(type='hidden', name='movie', value='#{movie._id}')
                        input(type='hidden', name='user', value='#{user._id}')
                        input#commentId(type='hidden', name='commentId')
                        label.sr-only.control-label(for='comment') 进行评论
                        textarea#comment.form-control(rows=3, name='content', placeholder='进行评论...')
                    .form-group
                        button.btn.btn-primary.pull-right(type='submit') 提交
            .col-md-4
                h4 电影名称：#{movie.name}
                h4 导演：#{movie.director}
                h4 上映时间：#{movie.year}
                p 简介：#{movie.summary}

    script(src='/js/comment.js', type='text/javascript')